<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>用户界面</title>
  <link rel="stylesheet" type="text/css" href="../static/all/css/AllUserPage.css" media="all">
  <link rel="stylesheet" type="text/css" href="../static/all/css/bootstrap.min.css" media="all" />
  <link href="https://fonts.googleapis.com/css2?family=Lato&display=swap" rel="stylesheet">
  <link rel="stylesheet" type="text/css" href="../static/all/css/btn.css" media="all" />
  <style>
    .innerContent{
      background-color: white;
      border: 0px solid #000000;

      -moz-border-radius: 15px;

      -webkit-border-radius: 15px;

      border-radius:20px;
    }

    form>div{
      margin-left: 40px;
      margin-right: 40px;
    }

    .menu>li{
      list-style-type: none;
    }

  </style>
</head>

<body>
  <input type="checkbox" id="check" />
  <label for="check">
    <svg viewBox="0 0 30 30" width="30" height="30">
      <path id="one" d="M4 10h22M4" stroke="#fff" stroke-width="2" stroke-linecap="round"></path>
      <path id="two" d="M4 20h22M4" stroke="#fff" stroke-width="2" stroke-linecap="round"></path>
    </svg> 菜 单
  </label>
  <div th:replace="~{adminpart/adminInfo::nav2}"></div>
  <article>
    <div class="wrapper">
      <!--<div class="content"></div>-->

      <div class="container">
        <div style="margin-top: 100px;background: antiquewhite" class="row">
          <div class="span3">
          </div>
          <div class="span6">
            <div class="form-group">
              <table style="text-align: center" class="table table-bordered table-hover">
                <thead>
                <tr>
                  <th>
                    用户ID
                  </th>
                  <th>
                    学院
                  </th>
                  <th>
                    姓名
                  </th>
                  <th>
                    未登记次数
                  </th>
                  <th>
                    最近一次未登记时间
                  </th>
                </tr>
                </thead>
                <tbody>
                <tr th:each="user:${pageInfo.list}">
                  <td th:text="${user.userId}"></td>
                  <td th:text="${user.college}"></td>
                  <td th:text="${user.realName}"></td>
                  <td th:text="${user.lackdays}"></td>
                  <td th:text="${user.recentday}"></td>
                </tr>
                </tbody>
              </table>
            </div>
            <div>
              <p >当前第<span th:text="${pageInfo.pageNum}"></span>页，总<span th:text="${pageInfo.pages}"></span>页，共<span th:text="${pageInfo.total}"></span>条记录</p>
            </div>
            <nav aria-label="...">
              <ul class="pager">
                <li><button class="custom-btn btn-8" onclick="prepage()">上一页</button></li>
                <li><button class="custom-btn btn-8" onclick="nextpage()">下一页</button></li>
              </ul>
            </nav>
          </div>

          <div class="span3">
          </div>
        </div>
      </div>
      <div class="footer">
        <p></p>
      </div>
    </div>
  </article>
</body>
<script th:inline="javascript">
  var hasPreviousPage = [[${pageInfo.hasPreviousPage}]];
  var nextPage = [[${pageInfo.nextPage}]];
  var pages = [[${pageInfo.pages}]];
  var hasNextPage = [[${pageInfo.hasNextPage}]];
  var hasNextPage = [[${pageInfo.prePage}]];
  var username = [[${username}]];

  //<a th:href="@{/user/RegisterHistory(pagenum=${pageInfo.hasPreviousPage}?${pageInfo.prePage}:1+username=${username})}">上一页</a>

  function prepage() {
    $.ajax({
      url: "/admin/noRegisterMessage",
      type: 'post',
      data: {
        "pagenum" : hasPreviousPage?prepage():1,
        "username" : username
      },
      success: function (result) {
        // console.log(result);
        document.body.innerHTML="";
        document.write(result);
      },
      error : function (result) {
        // console.log(result);
        alert("请重试.");
      }
    });
  }


  //<a th:href="@{/user/RegisterHistory(pagenum=${pageInfo.hasNextPage}?${pageInfo.nextPage}:${pageInfo.pages})}">下一页</a>

  function nextpage() {
    $.ajax({
      url: "/admin/noRegisterMessage",
      type: 'post',
      data: {
        "pagenum" : hasNextPage?nextPage:pages,
        "username" : username
      },
      success: function (result) {
        // console.log(result);
        document.body.innerHTML="";
        document.write(result);
      },
      error : function (result) {
        // console.log(result);
        alert("请重试.");
      }
    });
  }


</script>

<script src="../static/all/js/bootstrap.min.js"></script>
<script src="../static/all/js/jquery-1.11.1.min.js"></script>

</html>